package com.github.wendao76.skill.exception;

import java.text.MessageFormat;

/**
 * 类描述信息
 *
 * @author wendao76
 * @version 1.0
 * @since 2022-3-7
 */
public interface BusinessExceptionAssert extends IExceptionEnum<Integer>, Assert {
  @Override
  default BaseException newException(Object... args) {
    String msg = MessageFormat.format(this.getMessage(), args);
    return new BusinessException(this, args, msg);
  }

  @Override
  default BaseException newException(Throwable t, Object... args) {
    String msg = MessageFormat.format(this.getMessage(), args);
    return new BusinessException(this, args, msg, t);
  }
}
